home *** CD-ROM | disk | FTP | other *** search
/ Champak 54 / Vol 54.iso / games / wiggi_wa.swf / scripts / DefineSprite_268 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  1.2 KB  |  42 lines

  1. function onEnterFrame()
  2. {
  3.    if(this.hitTest(_parent._parent._parent.STAGE))
  4.    {
  5.       i = 1;
  6.       while(i <= numSects)
  7.       {
  8.          this["flag" + i]._y = startY + Math.sin(w / speed + inc * i) * size;
  9.          i++;
  10.       }
  11.       w++;
  12.       if(this.hit.hitTest(_parent._parent.HERO.body) and hitSwitch == false)
  13.       {
  14.          _parent._parent.HERO.win = true;
  15.          _parent._parent.camElasticStore = 1000;
  16.          hitSwitch = true;
  17.          _parent._parent._parent.STAGE.newSound("Sound_Glass");
  18.          i = 1;
  19.          while(i <= numSects)
  20.          {
  21.             this["flag" + i].gotoAndStop(2);
  22.             i++;
  23.          }
  24.          flagBase.gotoAndStop(2);
  25.          _parent._parent._parent.MESSAGES.removeMovieClip();
  26.          stopAllSounds();
  27.          _parent._parent._parent.HUD.gotoAndStop("COMPLETE");
  28.          this._xscale = - this._xscale;
  29.          _parent._parent.function_newParticle(this._x,this._y,"Class_Particle",100);
  30.       }
  31.    }
  32. }
  33. hitSwitch = false;
  34. hit._visible = false;
  35. _xscale = - _xscale;
  36. var numSects = 10;
  37. var startY = -60;
  38. var size = 3;
  39. var speed = 5;
  40. var inc = 6.283185307179586 / numSects;
  41. var w = 0;
  42.